﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewRequest.aspx.cs" Inherits="PersonReimbursement.NewRequest" %>

<%@ Register Src="../../Processes/ProcessControl/UserInfo_TY.ascx" TagName="UserInfo"
    TagPrefix="ui" %>
<%@ Register Src="../../Processes/ProcessControl/ApprovalHistory_TY.ascx" TagName="ApprovalHistory"
    TagPrefix="ah" %>
<%@ Register Src="../../Processes/ProcessControl/Attachments_TY.ascx" TagName="Attachments"
    TagPrefix="attach" %>
<%@ Register Src="../../Processes/ProcessControl/ButtonList_TY.ascx" TagName="ButtonList"
    TagPrefix="btn" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>个人费用报销</title>
    <script src="../../js/jquery.js" type="text/javascript"></script>
    <script src="../../js/common.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../js/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" language="javascript">
        $(document).ready(function () {
            getSumJE();
            $("#txt_BXJEDX").text($("#fld_BXJEDX").val());
            $("#lbbxje").text($("#fld_BXJE").val());
            //            $('#fld_BXJE').bind('blur', function () {
            //                getSumJE();
            //            });
            //            $('#fld_BXJE').bind('keyup', function () {
            //                getSumJE();
            //            });
        });
        function changeRMB() {
            var JE = $("#fld_BXJE").val();
            var STRRMB = ChangeRMB(JE);
            $("#fld_BXJEDX").val(STRRMB);
            $("#txt_BXJEDX").text(STRRMB);
        }
        function getSumJE() {
            var Sum_JE = 0.00;
            $("#tbDetail tr:gt(0)").each(function (i, Etr) {
                var JE = $(Etr).find("td:eq(6)").children().val() - 0;
                if (!isNaN(JE)) {
                    Sum_JE += JE;
                }
                else {
                    $(Etr).find("td:eq(6)").children().val("");
                }
            });
            //$("#lbbxje").text(parseFloat(Sum_JE).toFixed(2));
            //$("#fld_BXJE").val(parseFloat(Sum_JE).toFixed(2));
            $("#lbbxje").text(Sum_JE);
            $("#fld_BXJE").val(Sum_JE);
            changeRMB();
        }
    </script>
    <script type="text/javascript" language="javascript">
        window.onload = function () {
            document.getElementById("fld_YHKH").onkeyup = function () {
                this.value = this.value.replace(/\s/g, '').replace(/(\d{4})(?=\d)/g, "$1 "); ;
            };
        }; </script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="container">
        <div class="row">
            <ui:userinfo id="UserInfo1" processtitle="个人费用报销" processprefix="BX" tablename="PROC_PERSONREIMBURSEMENT"
                tablenamedetail="PROC_PERSONREIMBURSEMENT_DT" runat="server"></ui:userinfo>
        </div>
        <div class="row">
            <table class="table table-condensed table-bordered">
                <tr>
                    <td class="banner" colspan="4">
                        详细信息
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        所属项目：
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_SSXM" runat="server"></asp:TextBox>
                    </td>
                    <td class="td-label">
                        编号：
                    </td>
                    <td class="td-content">
                        <asp:Label ID="fld_BH" runat="server" Text="自动生成"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        报销金额：
                    </td>
                    <td class="td-content">
                        <asp:Label runat="server" ID="lbbxje"></asp:Label>
                        <asp:TextBox ID="fld_BXJE" runat="server" Style="display: none" CssClass="validate[required,custom[number]]"></asp:TextBox>
                    </td>
                    <td class="td-label">
                        报销金额大写：
                    </td>
                    <td class="td-content">
                        <asp:Label ID="txt_BXJEDX" runat="server" Text=""></asp:Label>
                        <asp:TextBox ID="fld_BXJEDX" runat="server" Style="display: none"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        账户名：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_ZHM" runat="server" CssClass="validate[required]"></asp:TextBox>
                    </td>
                    <td class="td-label">
                        开户行：<span class="red">*</span>
                    </td>
                    <td class="td-content">
                        <asp:TextBox ID="fld_KHH" runat="server" CssClass="validate[required]"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td-label">
                        银行卡号：<span class="red">*</span>
                    </td>
                    <td class="td-content" colspan="3">
                        <asp:TextBox ID="fld_YHKH" runat="server" CssClass="validate[required]"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="td-label" valign="middle">
                        任务完成情况概述：
                    </td>
                    <td class="td-content" colspan="3">
                        <asp:TextBox TextMode="MultiLine" ID="fld_WCQKGS" Width="98%" Height="60px" runat="server"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="10">
                        <table class="table table-condensed table-bordered tablerequired" id="tbDetail">
                            <tr>
                                <th>
                                    黏贴单编号
                                </th>
                                <th>
                                    票据编号
                                </th>
                                <th>
                                    起始时间
                                </th>
                                <th>
                                    结束时间
                                </th>
                                <th style="width:120px;">
                                    类型
                                </th>
                                <th>
                                    票据内容
                                </th>
                                <th>
                                    金额
                                </th>
                                <th>
                                    备注
                                </th>
                                <th style="width:110px;">
                                    <asp:Button ID="btnAdd" runat="server" Text="增加" CssClass="btn" CausesValidation="false"
                                        OnClick="btnAdd_Click" />
                                </th>
                                <th style="display: none;">
                                    编号
                                </th>
                            </tr>
                            <asp:Repeater ID="fld_detail_PROC_PERSONREIMBURSEMENT_DT" runat="server" OnItemCommand="fld_detail_PROC_PERSONREIMBURSEMENT_DT_ItemCommand">
                                <ItemTemplate>
                                    <tr>
                                        <td>
                                            <asp:TextBox ID="fld_FORMID" Text='<%#Eval("FORMID") %>' runat="server" Style="display: none"></asp:TextBox>
                                            <asp:TextBox ID="fld_NDDBH" Text='<%#Eval("NDDBH") %>' runat="server" Width="90%"
                                                CssClass="validate[required]"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="fld_PJBH" Text='<%#Eval("PJBH") %>' runat="server" Width="90%" CssClass="validate[required]"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="fld_STARTDATE" Text='<%#Eval("STARTDATE") %>' runat="server" Width="90%"
                                                OnClick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})" CssClass="Wdate validate[required,custom[date]]"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="fld_ENDDATE" Text='<%#Eval("ENDDATE") %>' runat="server" Width="90%"
                                                OnClick="WdatePicker({dateFmt:'yyyy-MM-dd',readOnly:true})" CssClass="Wdate validate[required,custom[date]]"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:DropDownList ID="fld_LX" runat="server" CssClass="validate[required]" SelectedValue='<%#Eval("LX") %>' Width="100%">
                                                <asp:ListItem Value="">--请选择--</asp:ListItem>
                                                <asp:ListItem Value="办公-办公用品">办公-办公用品</asp:ListItem>
                                                <asp:ListItem Value="办公-其他用品">办公-其他用品</asp:ListItem>
                                                <asp:ListItem Value="会议费">会议费</asp:ListItem>
                                                <asp:ListItem Value="差旅费-交通住宿">差旅费-交通住宿</asp:ListItem>
                                                <asp:ListItem Value="业务招待-招待费">业务招待-招待费</asp:ListItem>
                                                <asp:ListItem Value="业务招待-礼品">业务招待-礼品</asp:ListItem>
                                                <asp:ListItem Value="电话费">电话费</asp:ListItem>
                                                <asp:ListItem Value="邮寄费"></asp:ListItem>
                                                <asp:ListItem Value="车辆-租赁费">车辆-租赁费</asp:ListItem>
                                                <asp:ListItem Value="车辆-燃料费"></asp:ListItem>
                                                <asp:ListItem Value="车辆-过路停车费"></asp:ListItem>
                                                <asp:ListItem Value="车辆-养路费"></asp:ListItem>
                                                <asp:ListItem Value="车辆-修理费"></asp:ListItem>
                                                <asp:ListItem Value="车辆-保险费"></asp:ListItem>
                                                <asp:ListItem Value="车辆-其他"></asp:ListItem>
                                                <asp:ListItem Value="物资消耗"></asp:ListItem>
                                                <asp:ListItem Value="低值易耗品"></asp:ListItem>
                                                <asp:ListItem Value="维修费"></asp:ListItem>
                                                <asp:ListItem Value="劳保费"></asp:ListItem>
                                                <asp:ListItem Value="租赁费"></asp:ListItem>
                                                <asp:ListItem Value="培训费"></asp:ListItem>
                                                <asp:ListItem Value="暖气费"></asp:ListItem>
                                                <asp:ListItem Value="装卸费"></asp:ListItem>
                                                <asp:ListItem Value="运输费"></asp:ListItem>
                                                <asp:ListItem Value="仓储费"></asp:ListItem>
                                                <asp:ListItem Value="保险费"></asp:ListItem>
                                                <asp:ListItem Value="招标费"></asp:ListItem>
                                                <asp:ListItem Value="诉讼费"></asp:ListItem>
                                                <asp:ListItem Value="聘请其他机构费"></asp:ListItem>
                                                <asp:ListItem Value="消防费"></asp:ListItem>
                                                <asp:ListItem Value="绿化费"></asp:ListItem>
                                                <asp:ListItem Value="广告费"></asp:ListItem>
                                                <asp:ListItem Value="水电费"></asp:ListItem>
                                                <asp:ListItem Value="劳务费"></asp:ListItem>
                                                <asp:ListItem Value="其他"></asp:ListItem>
                                            </asp:DropDownList>
                                            <%--<asp:TextBox ID="fld_LX" Text='<%#Eval("LX") %>' runat="server" Width="90%" CssClass="validate[required]"></asp:TextBox>--%>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="fld_PJNR" Text='<%#Eval("PJNR") %>' runat="server" Width="90%" CssClass="validate[required]"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="fld_JE" Text='<%#Eval("JE") %>' money="money" runat="server" Width="90%"
                                                onblur="getSumJE()" onkeyup="getSumJE()" CssClass="validate[required,custom[number]]"></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:TextBox ID="fld_BZ" Text='<%#Eval("BZ") %>' runat="server" Width="90%" CssClass="validate[required]">></asp:TextBox>
                                        </td>
                                        <td>
                                            <asp:Button ID="btnDelete" runat="server" Text="删除" CssClass="btn" CommandName="del"
                                                ClientIDMode="Static" OnClientClick="return confirm('确认删除？')" /><asp:Button ID="btnInsert"
                                                    runat="server" Text="插入" CssClass="btn" CommandName="insert" ClientIDMode="Static" />
                                        </td>
                                        <td style="display: none;">
                                            <asp:TextBox ID="fld_IDNO" Text='<%# Container.ItemIndex+1%>' runat="server"></asp:TextBox>
                                        </td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>
                        </table>
                    </td>
                </tr>
            </table>
        </div>
        <div class="row">
            <attach:attachments id="Attachments1" runat="server"></attach:attachments>
        </div>
        <div class="row">
            <ah:approvalhistory id="ApprovalHistory1" showaction="false" runat="server"></ah:approvalhistory>
        </div>
        <div class="row">
        </div>
    </div>
    <btn:buttonlist id="ButtonList1" runat="server"></btn:buttonlist>
    <div style="display: none;">
    </div>
    </form>
</body>
</html>
